CREATE TABLE [dbo].[CHUYEN_BAY]
(
[MA_TOUR] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TGDI] [datetime] NOT NULL,
[CBDI] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TGVE] [datetime] NOT NULL,
[CBVE] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CHUYEN_BAY] ADD CONSTRAINT [CHK_CHUYEN_BAY] CHECK ((datediff(day,[TGDI],[TGVE])>(0)))
GO
ALTER TABLE [dbo].[CHUYEN_BAY] ADD CONSTRAINT [PK__CHUYEN_B__A136D8E9854D0B51] PRIMARY KEY CLUSTERED  ([MA_TOUR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CHUYEN_BAY] ADD CONSTRAINT [FK_CB_TOUR] FOREIGN KEY ([MA_TOUR]) REFERENCES [dbo].[TOUR] ([MA_TOUR])
GO
